package com.wyzz.hr.pojo.base;

import java.io.Serializable;

import com.wyzz.hr.pojo.Role;

public abstract class BaseRole implements Serializable {

	public BaseRole() {
		hashCode = 0x80000000;
		initialize();
	}

	public BaseRole(String id) {
		hashCode = 0x80000000;
		setId(id);
		initialize();
	}

	public BaseRole(String id, String roleName, Integer roleSortId,
			String roleAuthority) {
		hashCode = 0x80000000;
		setId(id);
		setRoleName(roleName);
		setRoleSortId(roleSortId);
		setRoleAuthority(roleAuthority);
		initialize();
	}

	protected void initialize() {
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
		hashCode = 0x80000000;
	}

	public int getRoleNo() {
		return roleNo;
	}

	public void setRoleNo(int roleNo) {
		this.roleNo = roleNo;
	}

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public String getRoleDesc() {
		return roleDesc;
	}

	public void setRoleDesc(String roleDesc) {
		this.roleDesc = roleDesc;
	}

	public Integer getRoleSortId() {
		return roleSortId;
	}

	public void setRoleSortId(Integer roleSortId) {
		this.roleSortId = roleSortId;
	}

	public String getRoleAuthority() {
		return roleAuthority;
	}

	public void setRoleAuthority(String roleAuthority) {
		this.roleAuthority = roleAuthority;
	}

	public boolean equals(Object obj) {
		if (null == obj)
			return false;
		if (!(obj instanceof Role))
			return false;
		Role role = (Role) obj;
		if (null == getId() || null == role.getId())
			return false;
		else
			return getId().equals(role.getId());
	}

	public int hashCode() {
		if (0x80000000 == hashCode) {
			if (null == getId())
				return super.hashCode();
			String hashStr = (new StringBuilder()).append(getClass().getName())
					.append(":").append(getId().hashCode()).toString();
			hashCode = hashStr.hashCode();
		}
		return hashCode;
	}

	public String toString() {
		return super.toString();
	}

	public static String REF = "Role";
	public static String PROP_ROLE_NAME = "roleName";
	public static String PROP_ROLE_NO = "roleNo";
	public static String PROP_ROLE_AUTHORITY = "roleAuthority";
	public static String PROP_ROLE_DESC = "roleDesc";
	public static String PROP_ID = "id";
	public static String PROP_ROLE_SORT_ID = "roleSortId";
	private int hashCode;
	private String id;
	private int roleNo;
	private String roleName;
	private String roleDesc;
	private Integer roleSortId;
	private String roleAuthority;

}
